package cn.tedu.guan;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class GuanYu {

    private String name = "关羽";

    // Autowired 自动装配，从Spring容器中搜索合适的对象并为当前属性赋值
    @Autowired
    private DragonBlade dragonBlade;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public DragonBlade getDragonBlade() {
        return dragonBlade;
    }

    public void setDragonBlade(DragonBlade dragonBlade) {
        this.dragonBlade = dragonBlade;
    }

    @Override
    public String toString() {
        return "GuanYu{" +
                "name='" + name + '\'' +
                ", dragonBlade=" + dragonBlade +
                '}';
    }
}
